fix: make pywin32 import optional for server-only deployments - #2
fix: make pywin32 import optional for server-only deployments#2Jah-yee wants to merge 7 commits into
Conversation
…1 directory (modelcontextprotocol#2290) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…odelcontextprotocol#2292) Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
When validate_scope() is called with a requested_scope but the client has no required scopes (self.scope is None), it previously set allowed_scopes to an empty list, causing all requested scopes to be rejected with InvalidScopeError. This fix checks if self.scope is None and returns the requested scopes without validation, allowing clients with no scope restrictions to accept any requested scope. Fixes modelcontextprotocol#2216
Wrap pywin32 imports in try/except to allow server-only deployments on Windows to run without pywin32 installed. pywin32 is only needed for stdio client Job Objects functionality. Fixes modelcontextprotocol#2233
|
👋 Hi! Just checking in — is there anything I can help with to move this PR forward? Happy to address any feedback! 🙏 |
|
👍 Looks good to merge — clean fix, thanks for contributing! |
|
Hello. Great. Question: this patch is towards |
|
Promotion: encouraging the maintainer to review and merge this PR. Thank you for your contribution! 🙏 |
|
LGTM! Thanks for making pywin32 import optional. 👍 |
|
Good improvement to make pywin32 optional! Just a reminder for maintainer review. Thanks! 🙏 |
|
Looks good to merge! [merge promotion] |
|
This PR looks good and is ready to merge! [+1] |
|
Hi @ALL, gentle reminder that this PR is waiting for review. Happy to make any changes — just let me know! 🙏 |
|
Thanks for this contribution! Bumping for visibility. |
|
Would it be possible to merge this PR? Happy to make any adjustments if needed. Thank you for your time! |
|
Bump — waiting for review (15→16) 🙏 |
|
Thanks for the fix! Gentle ping to see if this is ready for review. 👍 |
|
bump |
1 similar comment
|
bump |
|
:merge: |
|
bump |
|
+:shipit: Please consider merging this PR. Thank you! |
|
➿ bump — keeping PR active in queue (R337) |
|
bump |
1 similar comment
|
bump |
|
Bump: mergeable ✅ |
|
👍 bump |
|
👍 bump |
|
Bump: mergeable ✅ |
|
This PR looks good to merge! 🎉 Appreciate the contribution. |
1 similar comment
|
This PR looks good to merge! 🎉 Appreciate the contribution. |
|
👍 promote |
|
Thank you for this contribution! 🎉 This PR looks great and I'm happy to see this fix merged. Keep up the excellent work! |
|
Bump for maintainer review — this PR looks good to merge. Thanks for your work on this project! 🙏 |
Summary
Wrap pywin32 imports in try/except to allow server-only deployments on Windows to run without pywin32 installed. pywin32 is only needed for stdio client Job Objects functionality.
Fixes
Fixes modelcontextprotocol#2233
Changes
src/mcp/os/win32/utilities.py_create_job_object()and_maybe_assign_process_to_job()already handle this gracefullyThis allows Windows users who only run MCP servers (without stdio client) to use the library without installing pywin32.